<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionDispatch::Flash::FlashHash</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionDispatch::Flash::FlashHash 
            
                <span class="parent">&lt; 
                    
                    <a href="../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_dispatch/middleware/flash_rb.html">actionpack/lib/action_dispatch/middleware/flash.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>#</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-5B-5D">[]</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-5B-5D-3D">[]=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-alert">alert</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-alert-3D">alert=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-clear">clear</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>D</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-delete">delete</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-discard">discard</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>E</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-each">each</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-empty-3F">empty?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-c-from_session_value">from_session_value</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-initialize_copy">initialize_copy</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>K</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-keep">keep</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-key-3F">key?</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-keys">keys</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-notice">notice</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-notice-3D">notice=</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-now">now</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-now_is_loaded-3F">now_is_loaded?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>T</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FlashHash.html#method-i-to_hash">to_hash</a>,
              </li>
            
              
              <li>
                <a href="FlashHash.html#method-i-to_session_value">to_session_value</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="../../Enumerable.html">
              Enumerable
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-from_session_value">
            
              <b>from_session_value</b>(value)
            
            <a href="FlashHash.html#method-c-from_session_value" name="method-c-from_session_value" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-from_session_value_source')" id="l_method-c-from_session_value_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L76" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-from_session_value_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">from_session_value</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-identifier">flash</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
          <span class="ruby-keyword">when</span> <span class="ruby-constant">FlashHash</span> <span class="ruby-comment"># Rails 3.1, 3.2</span>
            <span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@flashes</span>), <span class="ruby-identifier">value</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@used</span>))
          <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span> <span class="ruby-comment"># Rails 4.0</span>
            <span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>[<span class="ruby-string">'flashes'</span>], <span class="ruby-identifier">value</span>[<span class="ruby-string">'discard'</span>])
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">new</span>
          <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">flash</span>.<span class="ruby-identifier">tap</span>(&amp;<span class="ruby-value">:sweep</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-5B-5D">
            
              <b>[]</b>(k)
            
            <a href="FlashHash.html#method-i-5B-5D" name="method-i-5B-5D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-5B-5D_source')" id="l_method-i-5B-5D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L113" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-5B-5D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 113</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-keyword ruby-title">k</span>)
  <span class="ruby-ivar">@flashes</span>[<span class="ruby-identifier">k</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-5B-5D-3D">
            
              <b>[]=</b>(k, v)
            
            <a href="FlashHash.html#method-i-5B-5D-3D" name="method-i-5B-5D-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-5B-5D-3D_source')" id="l_method-i-5B-5D-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L108" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-5B-5D-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 108</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-keyword ruby-title">k</span>, <span class="ruby-identifier">v</span>)
  <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">k</span>
  <span class="ruby-ivar">@flashes</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-alert">
            
              <b>alert</b>()
            
            <a href="FlashHash.html#method-i-alert" name="method-i-alert" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Convenience accessor for <code>flash[:alert]</code>.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-alert_source')" id="l_method-i-alert_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L211" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-alert_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 211</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">alert</span>
  <span class="ruby-keyword">self</span>[<span class="ruby-value">:alert</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-alert-3D">
            
              <b>alert=</b>(message)
            
            <a href="FlashHash.html#method-i-alert-3D" name="method-i-alert-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Convenience accessor for <code>flash[:alert]=</code>.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-alert-3D_source')" id="l_method-i-alert-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L216" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-alert-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">alert=</span>(<span class="ruby-identifier">message</span>)
  <span class="ruby-keyword">self</span>[<span class="ruby-value">:alert</span>] = <span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-clear">
            
              <b>clear</b>()
            
            <a href="FlashHash.html#method-i-clear" name="method-i-clear" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-clear_source')" id="l_method-i-clear_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L145" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-clear_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">clear</span>
  <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-delete">
            
              <b>delete</b>(key)
            
            <a href="FlashHash.html#method-i-delete" name="method-i-delete" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-delete_source')" id="l_method-i-delete_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L131" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-delete_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 131</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">delete</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">key</span>
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">key</span>
  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-discard">
            
              <b>discard</b>(k = nil)
            
            <a href="FlashHash.html#method-i-discard" name="method-i-discard" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Marks the entire flash or a single flash entry to be discarded by the end
of the current action:</p>

<pre>flash.discard              # discard the entire flash at the end of the current action
flash.discard(:warning)    # discard only the &quot;warning&quot; entry at the end of the current action</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-discard_source')" id="l_method-i-discard_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L197" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-discard_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 197</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">discard</span>(<span class="ruby-identifier">k</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">merge</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">k</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">k</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">self</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-each">
            
              <b>each</b>(&amp;block)
            
            <a href="FlashHash.html#method-i-each" name="method-i-each" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-each_source')" id="l_method-i-each_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L150" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-each_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 150</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">each</span>(&amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">each</span>(&amp;<span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-empty-3F">
            
              <b>empty?</b>()
            
            <a href="FlashHash.html#method-i-empty-3F" name="method-i-empty-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-empty-3F_source')" id="l_method-i-empty-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L141" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-empty-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 141</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">empty?</span>
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-initialize_copy">
            
              <b>initialize_copy</b>(other)
            
            <a href="FlashHash.html#method-i-initialize_copy" name="method-i-initialize_copy" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-initialize_copy_source')" id="l_method-i-initialize_copy_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L100" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-initialize_copy_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 100</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize_copy</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">now_is_loaded?</span>
    <span class="ruby-ivar">@now</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-ivar">@now</span>.<span class="ruby-identifier">flash</span> = <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-keep">
            
              <b>keep</b>(k = nil)
            
            <a href="FlashHash.html#method-i-keep" name="method-i-keep" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Keeps either the entire current flash or a specific flash entry available
for the next action:</p>

<pre>flash.keep            # keeps the entire flash
flash.keep(:notice)   # keeps only the &quot;notice&quot; entry, the rest of the flash is discarded</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-keep_source')" id="l_method-i-keep_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L188" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-keep_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">keep</span>(<span class="ruby-identifier">k</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">subtract</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">k</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">k</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">self</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-key-3F">
            
              <b>key?</b>(name)
            
            <a href="FlashHash.html#method-i-key-3F" name="method-i-key-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-key-3F_source')" id="l_method-i-key-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L127" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-key-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 127</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">key?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">key?</span> <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-keys">
            
              <b>keys</b>()
            
            <a href="FlashHash.html#method-i-keys" name="method-i-keys" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-keys_source')" id="l_method-i-keys_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L123" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-keys_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 123</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">keys</span>
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">keys</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-notice">
            
              <b>notice</b>()
            
            <a href="FlashHash.html#method-i-notice" name="method-i-notice" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Convenience accessor for <code>flash[:notice]</code>.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-notice_source')" id="l_method-i-notice_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L221" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-notice_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 221</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">notice</span>
  <span class="ruby-keyword">self</span>[<span class="ruby-value">:notice</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-notice-3D">
            
              <b>notice=</b>(message)
            
            <a href="FlashHash.html#method-i-notice-3D" name="method-i-notice-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Convenience accessor for <code>flash[:notice]=</code>.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-notice-3D_source')" id="l_method-i-notice-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L226" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-notice-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 226</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">notice=</span>(<span class="ruby-identifier">message</span>)
  <span class="ruby-keyword">self</span>[<span class="ruby-value">:notice</span>] = <span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-now">
            
              <b>now</b>()
            
            <a href="FlashHash.html#method-i-now" name="method-i-now" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Sets a flash that will not be available to the next action, only to the
current.</p>

<pre>flash.now[:message] = &quot;Hello current action&quot;</pre>

<p>This method enables you to use the flash as a central messaging system in
your app. When you need to pass an object to the next action, you use the
standard flash assign (<code>[]=</code>). When you need to pass an object
to the current action, you use <code>now</code>, and your object will
vanish when the current action is done.</p>

<p>Entries set via <code>now</code> are accessed the same way as standard
entries: <code>flash['my-key']</code>.</p>

<p>Also, brings two convenience accessors:</p>

<pre>flash.now.alert = &quot;Beware now!&quot;
# Equivalent to flash.now[:alert] = &quot;Beware now!&quot;

flash.now.notice = &quot;Good luck now!&quot;
# Equivalent to flash.now[:notice] = &quot;Good luck now!&quot;</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-now_source')" id="l_method-i-now_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L180" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-now_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 180</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">now</span>
  <span class="ruby-ivar">@now</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">FlashNow</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-to_hash">
            
              <b>to_hash</b>()
            
            <a href="FlashHash.html#method-i-to_hash" name="method-i-to_hash" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-to_hash_source')" id="l_method-i-to_hash_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L137" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-to_hash_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 137</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_hash</span>
  <span class="ruby-ivar">@flashes</span>.<span class="ruby-identifier">dup</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-to_session_value">
            
              <b>to_session_value</b>()
            
            <a href="FlashHash.html#method-i-to_session_value" name="method-i-to_session_value" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-to_session_value_source')" id="l_method-i-to_session_value_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L89" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-to_session_value_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_session_value</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">empty?</span>
  {<span class="ruby-string">'discard'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discard</span>.<span class="ruby-identifier">to_a</span>, <span class="ruby-string">'flashes'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@flashes</span>}
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
              
      <div class="sectiontitle">Instance Protected methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-now_is_loaded-3F">
            
              <b>now_is_loaded?</b>()
            
            <a href="FlashHash.html#method-i-now_is_loaded-3F" name="method-i-now_is_loaded-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-now_is_loaded-3F_source')" id="l_method-i-now_is_loaded-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/654f0d6a1520fc6a0a0396e78255a9ec50594e44/actionpack/lib/action_dispatch/middleware/flash.rb#L231" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-now_is_loaded-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/middleware/flash.rb, line 231</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">now_is_loaded?</span>
  <span class="ruby-ivar">@now</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    